package marksys.free.com.marksys.ui.adapter;

import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

import marksys.free.com.marksys.R;
import marksys.free.com.marksys.utils.DensityUtil;

public class TestAdapter extends SimpleTextAdapterT<String> {

    public TestAdapter() {
    }

    public TestAdapter(boolean checkable) {
        super(checkable);
    }

    public TestAdapter(boolean checkable, boolean singleCheck) {
        super(checkable, singleCheck);
    }

    public TestAdapter(boolean checkable, boolean singleCheck, boolean mustHaveCheck) {
        super(checkable, singleCheck, mustHaveCheck);
    }

    @Override
    protected Button createView(ViewGroup parent) {
        CheckBox checkBox = new CheckBox(parent.getContext());
        checkBox.setTextColor(parent.getResources().getColorStateList(R.color.color_filter));
        checkBox.setButtonDrawable(null);
        Drawable drawable = parent.getResources().getDrawable(R.drawable.simple_adapter_checkbox_bg);
        checkBox.setBackgroundDrawable(drawable);
        checkBox.setTextSize(15);
        checkBox.setGravity(Gravity.CENTER);
        checkBox.setPadding(0, DensityUtil.dip2px(parent.getContext(), 4), 0, DensityUtil.dip2px(parent.getContext(), 4));
        checkBox.setButtonDrawable(new ColorDrawable(0));
        return checkBox;
    }

}
